
#################
Contents
#################

data

	This folder contains the data from each wave of the survey experiment as well as data from the lab experiment at both the round level and subject level.

rmd

	This folder contains the Rscripts that are used during analysis.

plots

	This folder contains the plots that are output during the analysis. When the replication is run, the plots will be overwritten.

tables

	This folder contains the tables that are output during the analysis. When the replication is run, the tables will be overwritten.


instruments

	This folder contains the instruments for the survey and lab experiments for those interested in rerunning the experiments or running a modified version of the one of them.



#################
File Structure
#################

For these files to work properly, A single directory should contain the Rproject file print_version.Rproj and the data, plots, rmd, and tables folders at its root. When running any of the Rscripts, you should have the Rproject file print_version.Rproj open in Rstudio.


 
#################
Dependencies and Version Requirements
#################


Please use psych version 1.8.12. Newer versions have removed the fa2latex function used to make some of the tables.

The code also requires the following packages and works with the current version of these packages as of 2/1/2020

	here
	dplyr
	ggplot2
	lmtest
	xtable
	mediation
	texreg
	Matching
	tidyverse
	broom
	stargazer
	margins
	grf
	bife
	alpaca

#################
Replication Instructions
#################

To replicate the figures and tables in the paper, you need to open the Rproject print_version.Rproj from this repository. Then run the following scripts from the rmd folder: survey_experiment.r, survey_attrition_analysis.r, survey_causal_forest.R, and lab_analysis.R.



#################
Rscripts
#################

setup.R

	This Rscript loads the survey data from each wave, then merges and cleans the survey data. It is sourced by the other files, so it does not need to be run manually.

survey_experiment.r

	This Rscript does all of the analysis from the survey experiment in the main tex and the appendix except for the analysis in the appendix sections on attrition and heterogenous treatment effects.

survey_attrition_analysis.r

	This Rscript does the analysis of the survey experiment from the appendix section on attrition.

survey_causal_forest.R

	This Rscript does the analysis of the survey experiment from the appendix section on heterogenous treatment effects.

lab_analysis.R

	This Rscript does all of the analysis of the lab experiment from the main text and the appendix.

match_plot.r

	This Rscript contains some plot functions that are referenced by the other scripts. It is sourced by the scripts that use it, so it does not need to be run manually.



#################
data
#################

The following csv files contain data from waves of the survey experiment. Files with test in the name are processed outputs that are overwritten when the analysis is repeated. Files without test in the title are the raw data from the Qualtric surveys:

	embed_90.csv
	embed_90_test.data.csv
	first2k.csv
	first2k_test.data.csv
	full_experiment_wave2-5.csv


	#################
	Variables in Survey Experiment data
	#################

	The first several columns from StateDate to User Language are automatically generated by Qualtrics and not used in the analysis (except for StartDate, which contains the date and time the respondent began the survey, which is used to disguish amoung survey waves for the attrition analysis).

	age

		Respondent's age in years.

	male

		1 denotes respondent is a male and 0 denotes repondent is not male.

	edu

		Numeric values corresponding to the following levels of education in increasing order: • Less than high school
																								• High school or GED
																								• Some college
																								• 2-year college degree
																								• 4-year College degree
																								• Doctoral degree
																								• Professional degree (e.g., JD or MD)
    race
    	
    	Numeric values (coverted to factor class variable during analysis) corresponding to the following categories in increasing order:
    																																	"White","African-American","Asian", "Hispanic", "Native American",       
                              																											"Pacific Islander", "Other"

    income

    	Numeric values corresponding to the following levels of income in dollars in increasing order:
    																								• <30,000
																									• 30,000-40,000
																									• 40,000-50,000
																									• 50,000-60,000
																									• 60,000-70,000
																									• 70,000-80,000
																									• 80,000-90,000
																									• 90,000-100,000
																									• >100,000

	mturk_today

		Number of Mturk surveys respondent has completed today.

	mturk_week

		Number of Mturk surveys respondent has completed this week.

	mturk_life

		Total number of Mturk surveys respondent has completed

	grocerty_treat, humil_treat, and shame_treat

		The essay that respondents wrote in response to the essay prompt they were assigned. The text of these essays is not used in the analysis and has been redacted to comply with IRB protocols. The treatment assignment of a respondent can be determined by which of these three column contains "redacted" rather than being missing. 

	emo_* variables

		Emotional indicators where respondents rated how much they felt the way described by the phrase taking the place of * on a scale of 1
	(very slightly or not at all) to 5 (extremely). How these indicators are mapped into emotional scores is shown in Appendix G.4.

	pushout

		Binary variable that takes the value of 1 if respondent said US force should be used.

	strongly

		Binary variable that takes the value of 1 if respondent felt strongly about whether force should be used.

	democracy

		Binary variable taking the value of 1 if the respondent believed the country being invaded was a democracy.

	hr

		Binary variable taking the value of 1 if respondent believed the invader was committing major human rights violations.

	
	liberalism, strong_lib,	strong_cons, and more_lib

		Variables corresponding to the questions in appendix section G.7 that are used to generate a six point scale of conservative-liberal ideology.

	democrat, strong_dem,	strong_gop,	closer_dem

		Variables corresponding to the questions in appendix section G.7 that are used to generate a six point scale of GOP-Democrat partisanship.

	mil_mil* variables, flag_us_flag, and spend_milex

		Variables that contain respondent's answers to the questions in appendix section G.7 that are combined to form a miltiary assertiveness scale.

	essay

		Numeric value that corresponds to which grocerty_treat, humil_treat, and shame_treat is non-missing (indicating a respondent's essay treatment assignment).

	mil_DO* variables

		Automatically generated variables from qualtrics indicating which random display order for the mil_mil* variables respondents saw.

	MTurkCode

		Randomly generated code used to verify survey completion.

	cost_DO_high_cost

		1 if respondent was assigned to read US military action was costly and missing otherwise.

	Status_DO_yes_status

		1 if respondent was assigned to read US status was at stake and missing otherwise.

	Remaining variable with DO in name

		Variables indicating which randomized question order respondents were assigned that are not used in the analysis.

round_level.csv

	Contains data from the lab experiment at the subject-rounds of the game level of analysis. This file contains the following variables:

	session_id

		Factor indicating rounds in the same laboratory session of the experiment.

	period

		Numeric variable indicating the round of the game with -4 through 0 indicating practice rounds.

	subject

		Numeric variable indicating which respondent the data is for (resets each session).

	group

		Subjects that have the same group number in the same round of the same session played each other in that round.

	profit

		Amount of incentivized pay in dollars a respondent would receive if that round were randomly selected to determine payment.

	TotalProfit

		If this round was randomly selected to determine incentivized payment, then TotalProfit will = profit for that round. Otherwise it will be 0.

	Participate, rand, NumInGroup, R, Rank, and others_rand

		Variables used by z-Tree to run the experimental protocol but that are not used in the analysis.

	N

		Number of respondents in that labortatory session.

	NumGroups

		N divided by 2

	is_first_mover

		Binary variable taking the value of 1 if respondent went first in that round of the game.

	is_costly

		Binary variable taking the value of 1 if respondent was in the war is costly condition for that round of the game. 


	s,	first_strike,	first_struck,	and both_strike

		Payoffs corresponding to the neither strike, respondent strikes but is not struck, respondent is struck but does not strike, and both respondents strike outcomes of the game for that round in dollars.

	first_move

		Variable taking the value of 1 if the first mover attacked in that round and 2 if they did not attack.

	second_move

		Variable taking the value of 1 if the second mover attacked in that round and 2 if they did not attack.

	Time* variables

		Variables indicating how long respondents took before answering various questions. These variables were not used in the analysis.

subject_level.csv

	Contains subject-level demographic variables for the labortatory experiment. The demographic variables that were also included in the survey experiment 
	are measured identically and so are not repeated here.

	session_id

		Factor indicating which session of the lab experiment the subject participated in.

	subject

		Numeric variable indicating which respondent the data is for (resets each session).

	Time* variables

		Variables indicating how long respondents took before answering various questions. These variables were not used in the analysis.

	pre_* variables

		Pre-essay-treatment emotional indicators where respondents rated how much they felt the way described by the phrase taking the place of * on a scale of 1
		(very slightly or not at all) to 5 (extremely). How these indicators are mapped into emotional scores is show in Appendix G.4.

	post_* variables

		Post-essay-treatment emotional indicators where respondents rated how much they felt the way described by the phrase taking the place of * on a scale of 1 (very slightly or not at all) to 5 (extremely). How these indicators are mapped into emotional scores is show in Appendix G.4.

	ideo_1

		1-6 point liberal-conservative ideological scale with 6 being more liberal.

	pid_1

		1-6 point partisanship scale with 6 being more Democratic.

	pre_emo_group post_emo_group

		Variable indicating which of the randomized orders the respondents were asked the emotional indicator questions in.

	essay

		Internal variable used to generate essay assignments in z-tree. It is not used in the analysis.

	humil

		Binary variable taking the value of 1 if the respondent received the humiliation treatment and 0 if the control

	written_essay

		The essay that respondents wrote in response to the essay prompt they were assigned. The text of these essays is not used in the analysis and has been redacted to comply with IRB protocols.


#################
instruments
#################


These files are not needed to replicate the results of the data analysis. However, they can be imported to Qualtrics (for the survey experiment) and zTree (for the lab experiment) and used to rerun the experiments.

qualtrics_survey_instrument.qsf

	This is the survey experiment that was run in Qualtrics for the final wave. Please see the appendix section G.1 for differences between survey waves.

ztree

	This contains the treatments that were run in zTree. They are numbered based on the order that were run in each lab session. zTree and its leaves were run with the language option "/language english". The leaves were run with the fontsize option "/fontsize 30".